﻿@using InnovaApp.Layers.ResourcesLayer.Properties
@model INNOVACALL.Framework.Common.Models.ViewModels.MetaModels.Language_MetaModel
<table class="innoUI tblHeaderTbr tblHeaderTbrR">
    <tr>
        <td class="tdTbRR_L">
        </td>
        <td class="tdTbRR_M">
            @if (Request.IsAuthenticated)
            {
                <ul>
                    <li>Hello,
                        @{
                string href = "javascript:void(0);";   
                        }
                        <a href="@href" class="username">@User.Identity.Name</a></li>
                    <li>@Html.ActionLink("Log off", "", "LogOff")</li>
                </ul>
            }
            else
            {
                <ul>
                    <li><a href="/@Model.Language/register">@Resources.View_All_Register</a></li>
                    @{
                string returnUrl = string.Empty;
                string requestedUrl = Request.RawUrl;
                if (
                        requestedUrl.ToLower().Contains("/register")
                        ||
                        requestedUrl.ToLower().Contains("/accountactivation")
                        ||
                        requestedUrl.ToLower().Contains("/logon")
                )
                {
                    returnUrl = "/";
                }
                else
                {
                    returnUrl = Server.UrlEncode(requestedUrl);
                }
                string href = "/" + Model.Language + "/logon?ReturnUrl=" + returnUrl;
                    }
                    <li><a href="@href">@Resources.View_All_LogOn</a></li>
                </ul>
            }
        </td>
        <td class="tdTbRR_R">
        </td>
    </tr>
</table>
